<template>
    <div class="common-layout">
        <el-container>
            <el-header style="background-color: blueviolet; color: azure; padding: 10px;">
                智慧城市管理云平台

               
                <span style="float: right;">

                     欢迎您,{{ pinia.loginDto.realName }}({{ pinia.loginDto.accountName }}),{{pinia.loginDto.roleName  }}
                <el-button type="link" @click="logout()">退出</el-button>
                </span>

            </el-header>
           <el-container>
                <el-aside width="200px">
                    <el-menu active-text-color="#ffd04b" background-color="#545c64" class="el-menu-vertical-demo"
                        default-active="1" text-color="#fff"  router>
                        <el-sub-menu index="1">
                            <template #title>
                                <el-icon>
                                    <location />
                                </el-icon>
                                <span>流程引擎</span>
                            </template>

                                <el-menu-item index="category">流程类别</el-menu-item>
                                <el-menu-item index="from">流程表单</el-menu-item>
                                <el-menu-item index="nodeCfg">节点配置</el-menu-item>
                                <el-menu-item index="node">节点管理</el-menu-item>
                        </el-sub-menu>

                          <el-sub-menu index="2">
                            <template #title>
                                <el-icon>
                                    <location />
                                </el-icon>
                                <span>事件处置</span>
                            </template>

                                <el-menu-item index="instance">添加实例</el-menu-item> 
                                <el-menu-item index="myProcess">我的待办</el-menu-item> 
                                <el-menu-item index="myProcess2">测试页面</el-menu-item> 
                        </el-sub-menu>

                        
                        
                        
                    </el-menu>
                </el-aside>

                <el-main>
                    <RouterView />

                    <!-- <el-button @click="getWeather()">获取天气</el-button> -->
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>
<script setup lang="ts">
import myAxios from '@/http/axiosHelper';
import router from '@/router';
import { useCounterStore } from '@/stores/counter';

const pinia = useCounterStore()

const logout = () => {
    pinia.loginDto.accountName = ''
    pinia.loginDto.realName = ''
    pinia.loginDto.roleName = ''
    pinia.loginDto.jwtToken = ''

    router.push('/');
}

const getWeather=()=>{
    myAxios.get('/BasicData/WeatherForecast').then(res=>{
        console.log(res);
        

    });
}

</script>